<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>第一个js页面</title>
    <script type="text/javascript">
        function test() {
            // alert("helloworld");
            // var msg = prompt("请输入用户名","tom");
            // console.info("msg="+msg);
            /*
            var flag = confirm("are you man?");
            if(flag) {
                console.info("hi man");
            }else {
                console.info("hi woman");
            }
             */
        }
        function test2() {
            var name = document.getElementById("inputA").name;
            console.info(name);
            var value = document.getElementsByName("input")[1].value;
            document.getElementById("myspan").innerHTML = value;
            document.getElementsByTagName("input")[2].value = "点击过";
        }
    </script>
</head>
<body>
    <input type="button" value="inputA" id="inputA"
           name="input" onclick="javascript:window.alert('helloworld')">
    <input type="button" value="inputB" id="inputB"
           name="input" onclick="test()">
    <input type="button" value="点击" onclick="test2()">
    <span id="myspan"></span>
</body>
</html>